home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
PET
/
E-Education
/
(e)d2.d64
/
snail.c64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2008-11-26
|
21KB
|
881 lines
100 PRINT"":C5=1:POKE53280,6:POKE53281,6:GOSUB2710
110 WW$=""
120 SN$="[147] SNAIL "
130 GOSUB1830
140 DIM NE$(25),NW$(25),NX$(25),K(20),L(20),X2(9,20),Y2(9,20),G2(9,20):Z9=102
150 GOSUB 1380
160 PRINT"[147]":GOSUB1660
170 P=1484:Y=0:P5=55756:POKEP,Y:POKEP5,C5
180 C$=""
190 GOTO 360
200 PRINTC$" "
210 RETURN
220 :
230 XR=LEN(PL$(I)):AX=AX+1
240 RX$(AX)=MID$(PL$(I),3,XR-1)
250 G3(AX)=I
260 FORBX=1TOMX
270 IFMID$(PL$(BX),1,1)<>"*"THEN290
280 GOSUB300:IFRX$(AX)=RY$(AX)THENI=BX-1:BX=MX
290 NEXTBX:RETURN
300 XY=LEN(PL$(BX))
310 RY$(AX)=MID$(PL$(BX),3,XY-1):RETURN
320 :
330 W$=""
340 PRINTW$" "
350 RETURN
360 Z$="":O1=0:PRINTC$" "
370 PRINT" "
380 PRINTC$" WHAT WOULD YOU LIKE TO DO ?"
390 GETZ$:IFZ$<>""THEN430
400 IFPEEK(654)=0THEN390
410 IFPEEK(654)=2THENGOSUB8470:POKE198,0:GOTO360
420 GOTO390
430 IFZ$="_"THEN3690
440 IFZ$="D"THENMS$=" DRAW [146]":GOTO550
450 IFZ$="M"THENMS$=" MOVE [146]":GOTO610
460 IFZ$="J"THEN3350
470 IFZ$="E"THENMS$=" ERASE [146]":GOTO580
480 IFZ$="T"THENMS$=" TEACH [146]":GOTO700
490 IFZ$="S"THENMS$=" SELECT [146]":GOTO1480
500 IFZ$="R"THENMS$=" RECALL [146]":GOTO1840
510 IFZ$="W"THENPOKE252,32:POKE2,C5:FR$="":GOSUB2540:GOTO360
520 IFZ$="F"THENPOKE252,160:POKE2,C5:FR$="":GOSUB2540:GOTO360
530 IFZ$="Q"THEN1310
540 GOTO 360
550 PRINT"";MS$
560 GOSUB940:GOSUB1050:IFO1=2THEN360
570 X=Z9:GOTO1220
580 PRINT"";MS$
590 GOSUB940:GOSUB1050:IFO1=2THEN360
600 X=32:GOTO1220
610 PRINT"";MS$
620 GOSUB940:GOSUB1050:IFO1=2THEN360
630 POKE P,32
640 FORI=1TOD1:V1=PEEK(P+D):C8=C5
650 IFV1=35THENI=D1:GOTO670
660 P=P+D:P5=P5+D
670 NEXTI:POKEP,0:POKEP5,C8:GOSUB2630
680 REM
690 V1=0:GOTO360
700 PRINT"";MS$:P9=0:SQ$="":SB$="":SM$="":GOSUB200
710 PRINTC$" HOW MANY LINES?(THEN PRESS RETURN[146]) ";
720 GETT$:IFT$=""THEN720
730 IFT$="@"THEN360
740 IFT$=CHR$(13)THEN780
750 SQ$=SM$+T$:PRINTSQ$;:SB$=SB$+SQ$:T$=""
760 P9=P9+1:IFP9>2THEN700
770 GOTO720
780 T=VAL(SB$)
790 IFT<1ORT>20THEN700
800 FORJ=1TOT:GOSUB200:GOSUB330
810 PRINTW$"STEP #";J
820 GOSUB940:L(J)=D:GOSUB1050:K(J)=D1
830 NEXTJ
840 FORJ=1TOT:GOSUB870:NEXTJ
850 REM
860 GOSUB330:GOTO360
870 REM
880 FORI=1TOK(J):C8=C5
890 V1=PEEK(P+L(J))
900 IFV1=35THENI=K(J):GOTO930
910 POKEP+L(J),0:POKEP5+L(J),C8:GOSUB2600
920 POKEP,Z9:POKEP5,C8:FORN=1TO20:NEXTN:P=P+L(J):P5=P5+L(J)
930 NEXTI:V1=0:GOSUB2630:RETURN
940 REM
950 GOSUB 200
960 PRINTC$" WHICH WAY(U[146]P,D[146]OWN,L[146]EFT,R[146]IGHT,A[146]NGLE)?"
970 GETM$:IFM$=""THEN970
980 IFM$="@"THENO1=2:RETURN
990 IFM$="U"THEN D=-40:RETURN
1000 IF M$="D"THEN D=40:RETURN
1010 IFM$="L"THEND=-1:RETURN
1020 IFM$="R"THEND=1:RETURN
1030 IFM$="A"THENGOSUB1120:RETURN
1040 GOTO940
1050 IFO1=2THENRETURN
1060 GOSUB 200
1070 PRINTC$" HOW FAR (1-9)?"
1080 GETD$:IFD$=""THEN1080
1090 D1=VAL(D$)
1100 IFD1<1ORD1>9THEN1050
1110 RETURN
1120 REM
1130 GOSUB 200
1140 PRINTC$"ANGLE DIRECTION?"
1150 GETZ$:IFZ$=""THEN1150
1160 IFZ$="1"THEN D=-39:GOTO1210
1170 IF Z$="7"THEN D=-41:GOTO1210
1180 IF Z$="5"THEN D=39:GOTO1210
1190 IF Z$="3"THEN D=41:GOTO1210
1200 GOTO1120
1210 RETURN
1220 REM
1230 FORI=1TOD1:V1=PEEK(P+D)
1240 IFV1=35THENI=D1:GOTO1270
1250 GOSUB2600:POKEP,X:POKEP5,C5:POKEP+D,0:POKEP5+D,C5
1260 P=P+D:P5=P5+D
1270 NEXT I
1280 GOSUB2630
1290 REM
1300 V1=0:GOTO360
1310 REM
1320 GOSUB200
1330 PRINTC$"[145][145]PLAY AGAIN (Y/N)?"
1340 GETX$:IFX$=""THEN1340
1350 IFX$="Y"THENRUN
1360 PRINT"[147]GOODBYE FOR NOW!"
1370 NEW:CLR:END
1380 PRINT"[147]"
1390 PRINT" SNAIL "
1400 PRINT" WELCOME TO SNAIL[146]!"
1410 PRINT" PRESS ANY KEY TO BEGIN"
1420 PRINT" EXPLORING MY WORLD!"
1430 PRINT" PRESS _ [146] FOR PROGRAM SNAIL "
1440 GETA$:IFA$=""THEN1440
1450 IFA$="_"THEN3690
1460 GOSUB1680:RETURN
1470 GOTO3180
1480 PRINT"";MS$:GOSUB330:GOSUB200:PRINTW$" TRAIL TYPE [1.([209]) 2.(.) 3.(+)]?"
1490 PRINTW$" TRAIL TYPE [1.([209]) 2.(.) 3.(+) 4.( )]?"
1500 GETZ$:IFZ$=""THEN1500
1510 Q6=VAL(Z$)
1520 IFQ6<1ORQ6>4THEN1500
1530 IFQ6=1THENZ9=81
1540 IFQ6=2THENZ9=46
1550 IFQ6=3THENZ9=43
1560 IFQ6=4THENZ9=32
1570 GOSUB330
1580 PRINTW$" COLOR(Y[146]ELLOW,C[146]YAN,W[146]HITE,B[146]LACK)"
1590 GETX$:IFX$=""THEN1590
1600 IFX$="Y"THENC5=7:GOTO1650
1610 IFX$="C"THENC5=3:GOTO1650
1620 IFX$="W"THENC5=1:GOTO1650
1630 IFX$="B"THENC5=0:GOTO1650
1640 GOTO1590
1650 GOSUB330:GOTO360
1660 SYS(50176):RETURN
1670 PRINT"[147]"
1680 PRINT" WHAT KIND OF TRAIL DO YOU WANT:"
1690 PRINT" 1. '[209]'"
1700 PRINT" 2. '*'"
1710 PRINT" 3. '+'"
1720 PRINT" 4. ' '"
1730 PRINT" ANSWER WITH (1,2,3 OR 4)"
1740 GETQ4$:IFQ4$=""THEN1740
1750 Q3=VAL(Q4$)
1760 IFQ3<1ORQ3>4THEN1670
1770 IFQ3=1THENZ9=81:GOTO1820
1780 IFQ3=2THENZ9=42:GOTO1820
1790 IFQ3=3THENZ9=43:GOTO1820
1800 IFQ3=4THENZ9=32:GOTO1820
1810 Z9=102
1820 RETURN
1830 PRINTCHR$(12):RETURN
1840 PRINT"";MS$
1850 X=Z9:Z$=""
1860 S1=1
1870 GOSUB200:GOSUB330
1880 PRINTC$" F1[146] NEXT SHAPE F7[146] THIS SHAPE"
1890 PRINTW$" SHAPE # [146]";S1;" ";NX$(S1)
1900 T7=PEEK(197):IFT7=64THEN1900
1910 IFT7=46THENPOKE198,0:GOSUB330:GOTO360
1920 IFT7=3THENPOKE198,0:GOTO1960
1930 IFT7=4THENS1=S1+1
1940 IFS1=10THENPOKE198,0:GOSUB330:GOTO360
1950 GOTO1870
1960 GOSUB330
1970 PRINTW$" SHAPE #";S1;" ";NX$(S1)
1980 GOSUB 200
1990 PRINTC$" CHOICE D[146]RAW,M[146]EMORIZE,T[146]URN,N[146]AME SHAPE)"
2000 Z$=""
2010 GETZ$:IFZ$=""THEN2010
2020 IFZ$="D"THEN2070
2030 IFZ$="M"THEN2210
2040 IFZ$="T"THEN2860
2050 IFZ$="N"THENGOSUB2400:GOTO1960
2060 GOSUB330:GOTO360
2070 REM
2080 GOSUB330
2090 IFSB(S1)=0THEN360
2100 FORK=1TOSB(S1)
2110 D=X2(S1,K):D1=Y2(S1,K):GOSUB2120:NEXTK:GOTO360
2120 REM
2130 FORI=1TOD1:V1=PEEK(P+D):C8=C5
2140 IFV1=35THENI=D1:GOTO2170
2150 POKEP+D,0:GOSUB2600:POKEP,X:POKEP5,C8:POKEP5+D,C8:FORN=1TO20:NEXTN
2160 P=P+D:P5=P5+D
2170 NEXTI
2180 GOSUB2630
2190 V1=0
2200 RETURN
2210 P9=0:XZ$="":XC$="":XV$=""
2220 Z$=""
2230 GOSUB 200
2240 PRINTC$"HOW MANY LINES? (THEN PRESS RETURN[146]) ";
2250 GETZ$:IFZ$=""THEN2250
2260 IFZ$=CHR$(13)THEN2290
2270 XZ$=XC$+Z$:PRINTXZ$;:XV$=XV$+XZ$:Z$="":P9=P9+1:IFP9>2THEN2210
2280 GOTO2250
2290 SB(S1)=VAL(XV$):GOSUB330
2300 IFSB(S1)<1ORSB(S1)>20THEN2210
2310 FOR K=1TO SB(S1)
2320 GOSUB 330
2330 PRINTW$"LINE #";K
2340 GOSUB 950
2350 X2(S1,K)=D:G2(S1,K)=D
2360 GOSUB 1050
2370 Y2(S1,K)=D1
2380 NEXT K
2390 GOSUB330:GOTO360
2400 REM
2410 NA$="":NE$(S1)="":NX$(S1)=""
2420 Z$=""
2430 GOSUB330
2440 PRINTW$"NAME SHAPE #";S1;"(THEN PRESS RETURN[146])
2450 [141] 200
2460 [153]C$"NAME?";
2470 [161] NA$:[139]NA$[178]""[167]2470
2480 [139]NA$[178][199](13)[167][142]
2490 NW$(S1)[178]NE$(S1)[170]NA$
2500 [153] NW$(S1);
2510 HJ[178][194](152):[139]HJ[178]1[167][138]
2520 NX$(S1)[178]NX$(S1)[170]NW$(S1)
2530 NA$[178]"":[137]2470
2540 [143]
2550 [141]200:[153]C$" ";FR$
2560 [158](12[172]4096):[151]P,0:[142]
2570 [151]59467,16:[151]59466,85
2580 [151]59464,150:[129]Q[178]1[164]10:[130]Q
2590 [151]59467,0:[142]
2600 [151]54296,15:[151]54277,100:[151]54278,100:[151]54276,17
2610 [151]54273,64:[151]54272,75:[129]Q[178]1[164]10:[130]Q:[151]54276,0:[151]54277,0
2620 [151]54278,0:[142]
2630 [151]54296,10:[151]54277,75:[151]54278,75:[151]54276,17
2640 [129]Q[178]50[164]1[169][171]5:[151]54273,34[170]Q:[151]54272,75
2650 [129]T[178]1[164]5:[130]T
2660 [130]Q:[151]54276,0:[151]54277,0:[151]54278,0:[151]54296,0:[142]
2670 [153]WW$;" PRESS THE RETURNWAIT KEY!"
2680 [161]X$:[139]X$[178]""[167]2680
2690 [139]X$[179][177][199](13)[167]2680
2700 [142]
2710 [153]"LOAD
2720 PRINT"
2730 [153]" (null)(null)(null)(null)(null)(null)
2740 PRINT" [206] [210][210][210][210] [205]
2750 [153]" (null) (null) (null) (null)(null) (null) (null)
2760 PRINT" [205] [206] [206] [206] [205] [205] [205]
2770 [153]" (null) (null) (null) (null) (null)(null) (null) (null) (null)
2780 PRINT" [213][195][201][206] [205] [205] [205][206] [206] [206] [206]
2790 [153]" MID$LEN(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)>>>
2800 PRINT"
2810 [153]" S N A I L
2820 PRINT"
2830 [153]" R. PRACHUN 1982
2840 GOSUB8110:GOSUB8550:GOSUB8850
2850 RETURN
2860 AT=0
2870 GOSUB200:PRINTC$" ANGLE(1.[146]45,2.[146]90,3.[146]180)"
2880 GETZ$:IFZ$=""THEN2880
2890 T8=VAL(Z$):IFT8<1ORT8>3THEN2880
2900 IFT8=1THENAT=45
2910 IFT8=2THENAT=90
2920 IFT8=3THENAT=180
2930 GOSUB200:PRINTC$" REPEAT (Y/N)?"
2940 GETX$:IFX$=""THEN2940
2950 IFX$="N"THENGOSUB200:GOSUB330:GOTO3010
2960 IFX$<>"Y"THEN2940
2970 GOSUB200:PRINTC$" HOW MANY REPEATS (1-9)?"
2980 GETZ$:IFZ$=""THEN2980
2990 I3=VAL(Z$):IFI3<1ORI3>9THEN2980
3000 GOSUB200:GOTO3010
3010 FORRP=1TOI3
3020 FORK=1TOSB(S1)
3030 IFAT=45THENGOSUB3080
3040 IFAT=90THENGOSUB3180
3050 IFAT=180THENGOSUB3280
3060 D=G2(S1,K):D1=Y2(S1,K)
3070 GOSUB2120:NEXTK,RP:I3=1:AT=0:GOSUB330:GOTO360
3080 REM
3090 IFG2(S1,K)=1THENG2(S1,K)=41:RETURN
3100 IFG2(S1,K)=41THENG2(S1,K)=40:RETURN
3110 IFG2(S1,K)=40THENG2(S1,K)=39:RETURN
3120 IFG2(S1,K)=39THENG2(S1,K)=-1:RETURN
3130 IFG2(S1,K)=-1THENG2(S1,K)=-41:RETURN
3140 IFG2(S1,K)=-41THENG2(S1,K)=-40:RETURN
3150 IFG2(S1,K)=-40THENG2(S1,K)=-39:RETURN
3160 IFG2(S1,K)=-39THENG2(S1,K)=1:RETURN
3170 RETURN
3180 REM
3190 IFG2(S1,K)=1THENG2(S1,K)=40:RETURN
3200 IFG2(S1,K)=41THENG2(S1,K)=39:RETURN
3210 IFG2(S1,K)=40THENG2(S1,K)=-1:RETURN
3220 IFG2(S1,K)=39THENG2(S1,K)=-41:RETURN
3230 IFG2(S1,K)=-1THENG2(S1,K)=-40:RETURN
3240 IFG2(S1,K)=-41THENG2(S1,K)=-39:RETURN
3250 IFG2(S1,K)=-40THENG2(S1,K)=1:RETURN
3260 IFG2(S1,K)=-39THENG2(S1,K)=41:RETURN
3270 RETURN
3280 REM
3290 IFG2(S1,K)<0THENG2(S1,K)=ABS(X2(S1,K)):RETURN
3300 IFG2(S1,K)=1THENG2(S1,K)=-1:RETURN
3310 IFG2(S1,K)=41THENG2(S1,K)=-41:RETURN
3320 IFG2(S1,K)=40THENG2(S1,K)=-40:RETURN
3330 IFG2(S1,K)=39THENG2(S1,K)=-39:RETURN
3340 RETURN
3350 DF=0
3360 GOSUB3630
3370 QW=PEEK(203)
3380 IFQW=14THENTX=32:PRINT"ERASE[146]":POKE203,64:POKE198,0
3390 IFQW=18THENTX=Z9:PRINT"DRAW [146]":POKE203,64:POKE198,0
3400 GOSUB3450:GOSUB3530
3410 IFDF=2THENPOKE203,64:POKE198,0:GOTO360
3420 IFJV=0THENDF=0:GOTO3440
3430 GOSUB3490:DF=0
3440 GOTO3370
3450 REM JOYSTICK ROUTINE
3460 POKE56322,0:JV=PEEK(56320)
3470 FR=JV AND 16:JV=15-(JV AND 15)
3480 POKE56322,255:RETURN
3490 V1=PEEK(P+D):IFV1=35THEN3520
3500 GOSUB2600:POKEP+D,0:POKEP5+D,C5:POKEP,TX:POKEP5,C5
3510 P=P+D:P5=P5+D
3520 V1=0:RETURN
3530 IFFR<>16THENDF=2:RETURN
3540 IFJV=1THEND=-40:RETURN
3550 IFJV=2THEND=40:RETURN
3560 IFJV=4THEND=-1:RETURN
3570 IFJV=5THEND=-41:RETURN
3580 IFJV=6THEND=39:RETURN
3590 IFJV=8THEND=1:RETURN
3600 IFJV=9THEND=-39:RETURN
3610 IFJV=10THEND=41:RETURN
3620 JV=0:RETURN
3630 GOSUB200:PRINTC$" JOYSTICK[146] (D[146]RAW,E[146]RASE,Q[146]UIT)"
3640 GETX$:IFX$=""THEN3640
3650 IFX$="Q"THENDF=2:RETURN
3660 IFX$="E"THENTX=32:PRINT"ERASE":POKE203,64:POKE198,0:RETURN
3670 IFX$<>"D"THEN3640
3680 PRINT"DRAW ":TX=Z9:POKE203,64:POKE198,0:RETURN
3690 CLR:POKE53280,2:POKE53281,11:C5=1:VB=0:NM$="@"
3700 PRINTCHR$(142):GOSUB7820
3710 MX=500:DIM PL$(MX),CL$(MX),P2(40)
3720 Q$="[145]"
3730 MM=54296:M1=54276:M2=54277:M3=54278
3740 REM
3750 PRINT"[158][147] PROGRAM SNAIL "
3760 PRINT" SELECTION:"
3770 PRINT" 1.[146] WRITE/EDIT PROGRAM"
3780 PRINT" 2.[146] DISPLAY COMMANDS"
3790 PRINT" 3.[146] RUN A PROGRAM"
3800 PRINT" 4.[146] LIST (TO PRINTER)"
3810 PRINT" 5.[146] SAVE A PROGRAM"
3820 PRINT" 6.[146] LOAD A PROGRAM"
3830 PRINT" 7.[146] RENUMBER LINES"
3840 PRINT" 8.[146] DELETE PROGRAM
3850 [153]" 9.WAIT QUIT"
3860 [153]" YOUR CHOICE (1-9)"
3870 [161]X$:[139]X$[178]""[167]3870
3880 V[178][197](X$):[139]V[179]1[176]V[177]9[167]3870
3890 TA[178]0
3900 [145]V[141]4010,4420,4790,5370,5440,5620,7030,7630,5780
3910 [129]XV[178]1[164]9:SL(XV)[178]0:[130]XV
3920 [137]3750
3930 [143] *** SOUND EFFECTS ***
3940 [151]MM,15:[151]M2,100:[151]M3,100:[151]M1,17
3950 [151]54273,64:[151]54272,75:[129]D5[178]1[164]20:[130]D5
3960 [151]MM,0:[151]M1,0:[151]M2,0:[151]M3,0:[142]
3970 [151]MM,10:[151]M2,75:[151]M3,75:[151]M1,17
3980 [129]D5[178]50[164]1[169][171]5:[151]54273,34[170]D5:[151]54272,75
3990 [129]D6[178]1[164]5:[130]D6,D5
4000 [151]MM,0:[151]M1,0:[151]M2,0:[151]M3,0:[142]
4010 [139]PN$[179][177]""[167]4120
4020 [153]"LOAD WRITE MODE "
4030 [153]" TYPE IN YOUR FIRST NAME, PLEASE!"
4040 [153]" THEN PRESS THE RETURN WAIT KEY!"
4050 [133]" YOUR NAME? SINCMDCMDCMD";NM$
4060 [153]"LOAD PLEASE, TYPE IN THE NAME"
4070 [153]" OF THIS PROGRAM!"
4080 [153]" (MAXIMUM OF 7 LETTERS)
4090 PRINT" THEN PRESS THE RETURN [146] KEY"
4100 INPUT" NAME @[157][157][157]";PN$
4110 IFLEN(PN$)>7THENPN$=LEFT$(PN$,7)
4120 PRINT"[147] PROGRAM: [146] ";PN$;" AUTHOR: [146] ";NM$;""
4130 FORJ=1TOMY
4140 IFPL$(J)=""THEN4220
4150 PRINTJ;" ";PL$(J)
4160 IFPEEK(203)=60THEN4190
4170 IFPEEK(203)=46THEN4210
4180 GOTO4220
4190 GETZ$:IFZ$<>CHR$(13)THEN4190
4200 GOTO4220
4210 J=MY:POKE203,64:POKE198,0:GOTO4220
4220 NEXTJ
4230 PRINT"";:INPUT" LINE# 0[157][157][157]";HN$
4240 LN=VAL(MID$(HN$,1,3))
4250 IFLN>MXTHENPRINT" LINE# TOO HIGH!(MAX.500)":LN=0:PL$(LN)="":GOTO4230
4260 IFLN>MYTHENMY=LN
4270 IFLN=0THENPL$(LN)="":RETURN
4280 IFPL$(LN)<>""THENPL$(LN)=""
4290 PRINTQ$;" >? ";
4300 GETZ$:IFZ$=""THEN4300
4310 IFZ$=CHR$(13)THEN4370
4320 IFZ$=CHR$(20)THENPL$(LN)=LEFT$(PL$(LN),(TT-1)):PRINTCHR$(20);
4330 IFZ$=CHR$(20)THENTT=TT-1:GOTO4300
4340 MX$=Z$:PL$(LN)=PL$(LN)+MX$:TT=TT+1
4350 PRINTMX$;:IFTT=1THENGOSUB4400
4360 GOTO4300
4370 TT=0:PL$(LN)=PL$(LN)+"_":PRINT
4380 IFMID$(PL$(LN),1,1)="_"THENPL$(LN)=""
4390 GOTO4230
4400 MX$="/":PL$(LN)=PL$(LN)+MX$:TT=TT+1:PRINTMX$;:RETURN
4410 RETURN
4420 PRINT"[147] SNAIL:[146] PROGRAM COMMANDS"
4430 PRINT"SYMBOL & COMMAND"
4440 PRINT" D DRAW"
4450 PRINT" M MOVE"
4460 PRINT" T TURN TO ANGLE(RESET ANGLE=T/0)"
4470 PRINT" R REMARK [IGNORED BY SNAIL]"
4480 PRINT" G GO TO A SUBROUTINE AT THE LINE#"
4490 PRINT" E/G END OF A SUBROUTINE"
4500 PRINT" S SELECT A TRAIL TYPE"
4510 PRINT" L START OF LOOP(# TELLS HOW MANY]"
4520 PRINT" E/L END OF LOOP"
4530 PRINT" C COLOUR SELECTION [C,Y,W]"
4540 PRINT" J JUMP TO A LINE#"
4550 PRINT" W WIPE SCREEN CLEAR"
4560 PRINT" O CURSOR ORIGIN(1-9)"
4570 PRINT" Q QUESTION [WAITS FOR A Y OR N ]"
4580 PRINT" A ANSWER [A/Y/20=ON Y JUMP TO 20]"
4590 PRINT" P PRINT OUT TEXT"
4600 PRINT" H HOME SNAIL AND CLEAR HOME ROW"
4610 PRINT" PRESS ANY KEY"
4620 GETX$:IFX$=""THEN4620
4630 GOSUB8020
4640 PRINT"[147] LINE FORMAT EXAMPLE"
4650 PRINT" [197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197]"
4660 PRINT" LINE#","CODE"
4670 PRINT" 20","D/R/5"
4680 PRINT" 30","M/A/3/5"
4690 PRINT" 34","E"
4700 PRINT" ANGLE MOVES:"
4710 PRINT" [197][197][197][197][197][197][197][197][197][197][197]"
4720 PRINT" F7 F1"
4730 PRINT" [205][206]"
4740 PRINT" [206][205]"
4750 PRINT" F5 F3"
4760 PRINT" PRESS ANY KEY "
4770 GETX$:IFX$=""THEN4770
4780 RETURN
4790 REM
4800 W$="":SN$=" SNAIL":Z9=102:PE=0
4810 GOSUB4910:PRINT"[147]":GOSUB4840:GOSUB1660
4820 P=1484:P5=55756:Y=0:POKEP,Y:POKEP5,C5
4830 GOSUB 5130:RETURN
4840 PRINT"[147]";SN$:PRINT" TYPE OF RUN:"
4850 PRINT" 1. SINGLE STEP"
4860 PRINT" 2. CONTINUOUS RUN"
4870 PRINT" YOUR CHOICE (1-2)"
4880 GETX$:IFX$=""THEN4880
4890 QQ=VAL(X$):IFQQ<1ORQQ>2THEN4880
4900 PRINT"[147]":RETURN
4910 PRINT"[147]";SN$:PRINT" TYPE OF TRAIL "
4920 PRINT" 1. '[209]'"
4930 PRINT" 2. '*'"
4940 PRINT" 3. '+'"
4950 PRINT" 4. ' '"
4960 PRINT" YOUR CHOICE (1-3)"
4970 GETZ$:IFZ$=""THEN4970
4980 Q3=VAL(Z$):IFQ3<1ORQ3>4THEN4970
4990 IFQ3=1THENZ9=81
5000 IFQ3=2THENZ9=42
5010 IFQ3=3THENZ9=43
5020 IFQ3=4THENZ9=32
5030 PRINT"[147]";SN$:PRINT" COLOR OF TRAIL "
5040 PRINT" [159] C [146][158]YAN [158] Y [146][158]ELLOW"
5050 PRINT" W [146][158]HITE"
5060 PRINT" YOUR CHOICE (C,Y,W)"
5070 GETXX$:IFXX$=""THEN5070
5080 IFXX$="C"THENC5=3:GOTO5120
5090 IFXX$="Y"THENC5=7:GOTO5120
5100 IFXX$="W"THENC5=1:GOTO5120
5110 GOTO5070
5120 RETURN
5130 REM
5140 C$=""
5150 PRINTC$;" PROGRAM: [146] ";PN$
5160 FORI=1TOMX
5170 IFPL$(I)=""THEN5290
5180 IFQQ=2THEN5230
5190 PRINTW$" "
5200 PRINT" "
5210 PRINTW$;"[158] LINE# ";I
5220 PRINT" ";PL$(I)
5230 IFQQ=2THEN5250
5240 GETZ$:IFZ$=""THEN5240
5250 GOSUB5830
5260 IFPEEK(203)=46THENI=MX:GOTO5290
5270 IFPE=2THENI=MX
5280 IFLF=0THEN5290
5290 NEXTI
5300 PRINTW$" "
5310 PRINTC$" "
5320 PRINTC$" PROGRAM RUN COMPLETE "
5330 PRINTW$" PRESS RETURN KEY "
5340 GETZ$:IFZ$<>CHR$(13)THEN5340
5350 PRINTC$" "
5360 RETURN
5370 REM *** PRINTER LIST ***
5380 OPEN1,4
5390 PRINT#1,"PROGRAM: ";PN$;" AUTHOR: ";NM$:PRINT#1
5400 FORK=1TOMX
5410 IFPL$(K)=""THEN5430
5420 PRINT#1,K;" ";PL$(K)
5430 NEXTK:CLOSE1:RETURN
5440 GOSUB7570
5450 INPUT"[147] C [146]ASSETTE OR D [146]ISK C[157][157][157]";DV$
5460 IFDV$="D"THENDN=8
5470 INPUT" PROGRAM NAME @[157][157][157]";PN$
5480 IFDN=8THEN5540
5490 OPEN1,1,1,PN$
5500 PRINT#1,PZ
5510 FORK=1TOMX
5520 PRINT#1,PL$(K)
5530 NEXTK:PRINT#1,NM$:CLOSE1:RETURN
5540 OPEN2,8,2,PN$+",S,W"
5550 PRINT#2,PZ,CHR$(13)
5560 FORK=1TOPZ
5570 IFPL$(K)=""THENPL$(K)="<"
5580 PRINT#2,PL$(K),CHR$(13)
5590 NEXTK:PRINT#2,NM$
5600 CLOSE2
5610 RETURN
5620 REM
5630 INPUT"[147] C [146]ASSETTE OR D [146]ISK C[157][157][157]";DV$
5640 INPUT"PROGRAM NAME @[157][157][157]";PN$
5650 IFDV$="D"THEN5700
5660 OPEN1,1,0,PN$
5670 INPUT#1,PZ
5680 FORK=1TOPZ:INPUT#1,PL$(K):NEXTK:INPUT#1,NM$
5690 CLOSE1:MY=PZ:GOSUB7700:RETURN
5700 OPEN 2,8,2,PN$+",S,R"
5710 INPUT#2,PZ
5720 FORK=1TOPZ
5730 INPUT#2,PL$(K)
5740 NEXTK:INPUT#2,NM$
5750 CLOSE2
5760 MY=PZ:GOSUB7700
5770 RETURN
5780 PRINT"[147] WISH TO VISIT SNAIL (Y/N)?"
5790 GETX$:IFX$=""THEN5790
5800 IFX$="Y"THENRUN
5810 IFX$<>"N"THEN5790
5820 PRINT"[147] GOODBYE FOR NOW!!":END
5830 CM$=MID$(PL$(I),1,1)
5840 IFCM$="D"ORCM$="M"THENGOSUB6100:GOTO6030
5850 IFCM$="P"THENGOSUB7170:RETURN
5860 IFCM$="B"THENGOSUB230:RETURN
5870 IFCM$="Q"THENGOSUB7370:RETURN
5880 IFCM$="A"THENGOSUB7430:RETURN
5890 IFCM$="H"THENGOSUB7500:RETURN
5900 IFCM$="L"THENGOSUB6390:RETURN
5910 IFCM$="F"THENPOKE252,160:POKE2,C5:GOSUB2540:RETURN
5920 IFCM$="R"THENGOSUB7560:RETURN
5930 IFCM$="T"THENTA=VAL(MID$(PL$(I),3,3)):GH=TA:RETURN
5940 IFCM$="O"THENGOSUB6660:RETURN
5950 IFCM$="E"THENGOSUB8310:RETURN
5960 IFCM$="G"THENGOSUB6340:RETURN
5970 IFCM$="W"THENPOKE252,32:POKE2,C5:GOSUB2540:RETURN
5980 IFCM$="S"THENGOSUB6710:RETURN
5990 IFCM$="C"THENGOSUB6770:RETURN
6000 IFCM$="J"THENGOSUB6850:RETURN
6010 IFCM$="@"ORCM$="*"THEN RETURN
6020 ER$=" NO SUCH COMMAND! ":GOTO6940
6030 IFMID$(PL$(I),1,1)="M"THENX=32:GOTO6060
6040 IFPE=2THENRETURN
6050 GOSUB6980:RETURN
6060 POKEP,32:FORK=1TOD1:V1=PEEK(P+D)
6070 IFV1=35THENK=D1:GOTO6090
6080 P=P+D:P5=P5+D
6090 NEXTK:POKEP,0:POKEP5,C5:GOSUB3970:RETURN
6100 REM
6110 GOSUB6140:IFTA<>0THENGOSUB6400
6120 IFPE=2THENRETURN
6130 GOSUB6220:RETURN
6140 IFMID$(PL$(I),3,1)="A"THENGOSUB6270:RETURN
6150 IFTA<>0THENRETURN
6160 DR$=MID$(PL$(I),3,1)
6170 IFDR$="U"THEND=-40:RETURN
6180 IFDR$="D"THEND=40:RETURN
6190 IFDR$="R"THEND=1:RETURN
6200 IFDR$="L"THEND=-1:RETURN
6210 ER$=" NO SUCH DIRECTION! ":GOTO6940
6220 REM
6230 IFMID$(PL$(I),3,1)="A"THEND1=VAL(MID$(PL$(I),7,1)):GOTO6250
6240 D1=VAL(MID$(PL$(I),5,2))
6250 IFD1<1ORD1>20THENER$=" THE DISTANCE IS TOO FAR ":GOTO6940
6260 RETURN
6270 IFTA<>0THENRETURN
6280 DR=VAL(MID$(PL$(I),5,1))
6290 IFDR=1THEND=-39:RETURN
6300 IFDR=3THEND=41:RETURN
6310 IFDR=5THEND=39:RETURN
6320 IFDR=7THEND=-41:RETURN
6330 ER$=" NO SUCH ANGLE! ":GOTO6940
6340 REM
6350 VB=VB+1:G1(VB)=I
6360 G2=VAL(MID$(PL$(I),3,3))
6370 IFG2>MXTHENER$=" LINE # TOO HIGH! ":GOTO6940
6380 I=G2-1:RETURN
6390 LF=VAL(MID$(PL$(I),3)):LL=I+1:RETURN
6400 REM
6410 IFTA=45THENGOSUB6450:RETURN
6420 IFTA=90THENGOSUB6530:RETURN
6430 IFTA=180THENGOSUB6610:RETURN
6440 IFTA=0THENRETURN
6450 IFD=1THEND=41:RETURN
6460 IFD=41THEND=40:RETURN
6470 IFD=40THEND=39:RETURN
6480 IFD=39THEND=-1:RETURN
6490 IFD=-1THEND=-41:RETURN
6500 IFD=-41THEND=-40:RETURN
6510 IFD=-40THEND=-39:RETURN
6520 IFD=-39THEND=1:RETURN
6530 IFD=1THEND=40:RETURN
6540 IFD=41THEND=39:RETURN
6550 IFD=40 THEND=-1:RETURN
6560 IFD=39THEND=-41:RETURN
6570 IFD=-1THEND=-40:RETURN
6580 IFD=-41THEND=-39:RETURN
6590 IFD=-40THEND=1:RETURN
6600 IFD=-39THEND=41:RETURN
6610 IFD<0THEND=ABS(D):RETURN
6620 IFD=1THEND=-1:RETURN
6630 IFD=41THEND=-41:RETURN
6640 IFD=40THEND=-40:RETURN
6650 IFD=39THEND=-39:RETURN
6660 REM
6670 IFMID$(PL$(I),3)=""THENER$=" NO ORIGIN NUMBER ":GOTO6940
6680 WX=VAL(MID$(PL$(I),3)):IFSL(WX)=0THENSL(WX)=P:CL(WX)=P5:RETURN
6690 POKEP,32:P=SL(WX):P5=CL(WX):RETURN
6700 POKEP,32:P5=WX:P=ZX:RETURN
6710 REM
6720 IFMID$(PL$(I),3,1)="[209]"THENZ9=81:RETURN
6730 IFMID$(PL$(I),3,1)="*"THENZ9=42:RETURN
6740 IFMID$(PL$(I),3,1)="+"THENZ9=43:RETURN
6750 IFMID$(PL$(I),3,1)=" "THENZ9=32:RETURN
6760 ER$=" NO SUCH TRAIL! ":GOTO6940
6770 REM
6780 C1$=MID$(PL$(I),3,1)
6790 IFC1$="C"THENC5=3:GOTO6840
6800 IFC1$="Y"THENC5=7:GOTO6840
6810 IFC1$="W"THENC5=1:GOTO6840
6820 IFC1$="B"THENC5=0:GOTO6840
6830 ER$=" NO SUCH COLOR! ":GOTO6940
6840 RETURN
6850 REM
6860 J1=VAL(MID$(PL$(I),3,3))
6870 IFJ1>MXTHENER$=" LINE# TOO HIGH ":GOTO6940
6880 I=J1-1:RETURN
6890 REM
6900 RETURN
6910 REM
6920 V5=1105:FORL=1TO19
6930 FORM=1TO38:POKEV5,32:V5=V5+1:NEXTM:V5=V5+2:NEXTL:POKEP,0:RETURN
6940 PRINT"[147]"
6950 PRINT" ??????? [158]"
6960 PRINT" ";ER$:PRINT" IN LINE #";I
6970 PE=2:FORN=1TO500:NEXTN:RETURN
6980 X=Z9
6990 FORK=1TOD1:V1=PEEK(P+D):IFV1=35THENK=D1:GOTO7020
7000 POKEP+D,0:POKEP5+D,C5:POKEP,X:POKEP5,C5:GOSUB3930
7010 P=P+D:P5=P5+D
7020 NEXTK:GOSUB3970:V1=0:RETURN
7030 E=0:SL=0:LI=0:W=0:INPUT"[147] STARTING LINE# 1[157][157][157]";SL
7040 INPUT" LINE INCREMENT 2[157][157][157]";LI
7050 PRINT" PLEASE WAIT ! "
7060 W=SL:W=W-LI
7070 FORE=1TOMX
7080 IFPL$(E)=""THEN7110
7090 GOSUB7160:CL$(W)=PL$(E)
7100 PL$(E)=""
7110 NEXTE:MY=W
7120 FOREE=1TOMX
7130 IFCL$(EE)=""THEN7150
7140 PL$(EE)=CL$(EE):CL$(EE)=""
7150 NEXTEE:RETURN
7160 W=W+LI:RETURN
7170 REM
7180 P1=ASC(MID$(PL$(I),2,1))
7190 IFP1<>47THENER$=" OOPS! I DON'T UNDERSTAND! ":GOTO6940
7200 P6=3
7210 IFP6>32THENER$=" SENTENCE TOO LONG! ":GOTO6940
7220 P2(P6)=ASC(MID$(PL$(I),P6,1))
7230 IFP2(P6)=95THEN7290
7240 IFP2(P6)<65THEN7270
7250 P2(P6)=P2(P6)-64
7260 P2(P6)=ABS(P2(P6)):P6=P6+1:GOTO7210
7270 IFP2(P6)<1THENER$=" OOPS! I DON'T UNDERSTAND! ":GOTO6940
7280 P6=P6+1:GOTO7210
7290 FORP7=3TOP6-1
7300 POKEP,32:POKEP5,C5
7310 IFPEEK(P+1)=35THENP7=P6-1:GOTO7340
7320 POKEP,P2(P7):POKEP5,C5
7330 P=P+1:P5=P5+1
7340 NEXT P7
7350 POKEP,32:POKEP5,C5
7360 P6=0:RETURN
7370 REM GET ANSWER
7380 GETX$:IFX$=""THEN7380
7390 IFX$="Y"THEN7420
7400 IFX$="N"THEN7420
7410 GOTO7380
7420 AN$=X$:RETURN
7430 REM SELECT ANSWER
7440 D4$=MID$(PL$(I),3,1)
7450 IFD4$=AN$THEN7470
7460 RETURN
7470 J4=VAL(MID$(PL$(I),5,3))
7480 IFJ4>MXTHENER$=" LINE # TOO HIGH! ":GOTO6940
7490 I=J4-1:RETURN
7500 REM HOME SNAIL
7510 POKEP,32
7520 P=1105:P5=55377
7530 FORCS=1TO37:POKEP,32:P=P+1:NEXTCS:P=1105
7540 POKEP,0:POKEP5,C5
7550 RETURN
7560 QW=VAL(MID$(PL$(I),3)):KK=I+1:RETURN
7570 PRINT"[147] PLEASE WAIT ONE MOMMENT! ":W=0:FORSV=1TOMX
7580 IFPL$(SV)=""THEN7620
7590 W=W+1:CL$(W)=PL$(SV)
7600 PL$(SV)=""
7610 PL$(W)=CL$(W):CL$(W)=""
7620 NEXT SV:PZ=W:RETURN
7630 PRINT"[147] ARE YOU SURE (Y/N)? "
7640 GETZ$:IFZ$=""THEN7640
7650 IFZ$="N"THENRETURN
7660 IFZ$<>"Y"THEN7640
7670 PRINT" O.K. PLEASE WAIT! "
7680 PN$="":VB=0
7690 FORBB=1TOMX:PL$(BB)="":NEXTBB:RETURN
7700 PRINT" PLEASE WAIT ONE MOMENT! "
7710 W=0
7720 FORSV=1TOMX
7730 IFPL$(SV)=""THEN7760
7740 W=W+5:CL$(W)=PL$(SV)
7750 PL$(SV)=""
7760 NEXT SV
7770 FORSV=1TOMX
7780 IFCL$(SV)=""THEN7810
7790 PL$(SV)=CL$(SV)
7800 CL$(SV)=""
7810 NEXTSV:MY=W:RETURN
7820 PRINT"[147]"
7830 PRINT" [167][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][165]
7840 [153]" THEN PROGRAM SNAIL FN
7850 PRINT" [167] [165]
7860 [153]" THENTOTOTOTOTOTOTOTOTOTOTOTOTOTOTOTOFN
7870 PRINT" [164][164][164][164]
7880 [153]" (null) (null)
7890 PRINT" [206] [164][164] [205]
7900 [153]" (null) (null) (null) (null)
7910 PRINT" [215] [206] [206] [164][164] [205] [205]
7920 [153]" (null)TOFN (null) (null) (null) (null) FN
7930 PRINT" [206][187][205] [205] [205] [206] [206] [165]
7940 [153]" (null) (null) (null) (null) (null)(null)
7950 PRINT" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]
7960 [153]" R. PRACHUN <C> 1982
7970 PRINT" [163][163][163][163][163][163][163][163][163][163] [163][163][163][163][163][163][163][163]
7980 [153]"
7990 PRINT" PRESS ANY KEY TO BEGIN!
8000 [161]X$:[139]X$[178]""[167]8000
8010 [142]
8020 [153]"LOAD SYMBOL & COMMAND "
8030 [153]" N NEST A LOOP (N/3 )
8040 PRINT" #3 MEANS 3 TIMES"
8050 PRINT" E/N END OF NESTED LOOP"
8060 PRINT" E END THE PROGRAM
8070 [153]" F FILL THE SCREEN"
8080 [153]" PRESS ANY KEY "
8090 [161]Z$:[139]Z$[178]""[167]8090
8100 [142]
8110 [143]
8120 [129] K[178]0 [164] 74
8130 [135] Y9
8140 [151] (12[172]4096)[170]K,Y9
8150 [130] K:[142]
8160 [131] 169 , 216 , 133 , 179 , 169
8170 [131] 81 , 133 , 178 , 169 , 0
8180 [131] 133 , 251 , 169 , 4 , 133
8190 [131] 254 , 169 , 81 , 133 , 253
8200 [131] 160 , 0 , 165 , 252 , 145
8210 [131] 253 , 165 , 2 , 145 , 178
8220 [131] 200 , 192 , 38 , 208 , 243
8230 [131] 230 , 251 , 165 , 251 , 201
8240 [131] 19 , 240 , 23 , 24 , 165
8250 [131] 253 , 105 , 40 , 133 , 253
8260 [131] 24 , 165 , 178 , 105 , 40
8270 [131] 133 , 178 , 144 , 217 , 230
8280 [131] 254 , 230 , 179 , 24 , 144
8290 [131] 210 , 96 , 24 , 144 , 210
8300 [131] 96 , 255 , 255 , 255 , 255
8310 [139][202](PL$(I),3,1)[178]"L"[167]8390
8320 [139][202](PL$(I),3,1)[178]"G"[167]8360
8330 [139][202](PL$(I),3,1)[178]"R"[167]8420
8340 [139][202](PL$(I),3,1)[178]"*"[167]8450
8350 PE[178]2:[142]
8360 [143]
8370 I[178]G1(VB):VB[178]VB[171]1:[139]VB[179]0[167]VB[178]0
8380 G2[178]0:[142]
8390 LF[178]LF[171]1:[139]LF[178]0[167]8410
8400 I[178]LL
8410 [142]
8420 QW[178]QW[171]1:[139]QW[178]0[167]8440
8430 I[178]KK
8440 [142]
8450 I[178]G3(AX)[170]1:AX[178]AX[171]1:[139]AX[179]0[167]AX[178]0
8460 [142]
8470 [141]200:[141]330:HF[178]1
8480 [153]" COMMAND LIST: F1=NEXT F7=QUIT "
8490 [139]HF[178]7[167]HF[178]1
8500 [153]C$;" @ ";CD$(HF)
8510 SM[178][194](197)
8520 [139]SM[178]4[167]HF[178]HF[170]1:[141]200:[129]DL[178]1[164]50:[130]DL:[137]8490
8530 [139]SM[178]3[167][141]330:[142]
8540 [137]8510
8550 CD$(1)[178]" D WAIT DRAW <> M WAIT MOVE"
8560 CD$(2)[178]" E WAIT ERASE <> W WAIT WIPE"
8570 CD$(3)[178]" S WAIT SELECT A TRAIL"
8580 CD$(4)[178]" F WAIT FILL MY WORLD"
8590 CD$(5)[178]" T WAIT TEACH <> R WAIT RECALL"
8600 CD$(6)[178]" J WAIT JOYSTICK OPTION"
8610 [142]
8620 [131] 162 , 0 , 160 , 0 , 169
8630 [131] 35 , 157 , 40 , 4 , 157
8640 [131] 72 , 7 , 169 , 1 , 157
8650 [131] 40 , 216 , 157 , 72 , 219
8660 [131] 232 , 224 , 40 , 208 , 235
8670 [131] 162 , 0 , 160 , 0 , 169
8680 [131] 40 , 133 , 251 , 169 , 4
8690 [131] 133 , 252 , 169 , 40 , 133
8700 [131] 253 , 169 , 216 , 133 , 254
8710 [131] 32 , 68 , 196 , 169 , 79
8720 [131] 133 , 251 , 169 , 4 , 133
8730 [131] 252 , 169 , 79 , 133 , 253
8740 [131] 169 , 216 , 133 , 254 , 32
8750 [131] 68 , 196 , 96 , 160 , 0
8760 [131] 162 , 0 , 169 , 35 , 145
8770 [131] 251 , 169 , 1 , 145 , 253
8780 [131] 232 , 224 , 21 , 240 , 23
8790 [131] 24 , 165 , 251 , 105 , 40
8800 [131] 133 , 251 , 24 , 165 , 253
8810 [131] 105 , 40 , 133 , 253 , 144
8820 [131] 227 , 230 , 252 , 230 , 254
8830 [131] 24 , 144 , 220 , 96 , 0
8840 [131] 0 , 0 , 0 , 0 , 0
8850 [143]
8860 [143] BORDER ROUTINE
8870 [129]K[178]0[164]109
8880 [135] ZZ:[151]50176[170]K,ZZ
8890 [130] K:[142]